package com.bkhc.product.api;

import com.bkhc.common.annotation.ApiOperation;
import com.bkhc.common.annotation.ApiPackage;
import com.bkhc.common.annotation.AuditLog;
import com.bkhc.common.enu.OperationEnum;
import com.bkhc.common.util.response.ResultJson;
import com.bkhc.product.entity.Goods;
import com.bkhc.product.entity.GoodsSpec;
import com.bkhc.product.service.GoodsService;
import com.bkhc.product.service.ProductorService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author pcq
 * @date 2021/6/20 17:57
 */
@RestController
@RequestMapping("productor")
@Api("產品合夥人管理")
@ApiPackage(code="productor-api",name="產品合夥人管理实例服务",description = "后台產品合夥人管理实例服务维护操作接口")
public class ProductorController extends CommonController{
    @Autowired
    private ProductorService serivce;

    @ApiOperation(code="addProductor",name="添加產品合夥人",description = "添加產品合夥人")
    @AuditLog(object="Goods",operation = "添加產品合夥人",type = OperationEnum.add)
    @RequestMapping(path = "/add",method = RequestMethod.POST)
    public ResultJson<?> addProductor(@RequestParam(name="userId") String userId, @RequestParam(name="productCode") String productCode) {
        ResultJson<?> res = serivce.addProductor(userId,productCode);
        return res;
    }

    @ApiOperation(code="transferProductor",name="转移产品合伙人",description = "转移产品合伙人")
    @AuditLog(object="Goods",operation = "转移产品合伙人",type = OperationEnum.add)
    @RequestMapping(path = "/transter",method = RequestMethod.POST)
    public ResultJson<?> transter(@RequestParam(name="userId") String userId,@RequestParam(name="toUserId") String toUserId) {
        ResultJson<?> res = serivce.transterProductor(userId,toUserId);
        return res;
    }



}
